R programming with Sun Grid Engine

Use Rsge package to perfom paralle computing with SGE.

library(Rsge)

sub_func <- function(x, arg) x + arg
main_func <- function(x, arg) sub_func(x, arg)

index = 1:100
jobs = lapply(index, function(x) sge.submit(func=main_func, x=x, arg=arg, function.savelist=c('sub_func')))
status = lapply(jobs, sge.job.status)

while(any(status==1)) {
    Sys.sleep(4)
    status = lapply(jobs, sge.job.status)
}

results = lapply(jobs, sge.list.get.result)
Homepage
Comments

Hide Comments